<?php
/**
 * Created by PhpStorm.
 * User: cephei
 * Date: 12/24/15
 * Time: 4:02 PM
 */
namespace Plugins\ZhanqiSign;

use Core\PluginContainer;

class Register_ZhanqiSign{
    public function register(){
        PluginContainer::getInstance()->bind('zhanqisign',function(){
            return new Plugin_ZhanqiSign();
        });
    }
    public function install(\Closure $callback){
        $db = PluginContainer::getInstance()->singletonMake('database');
        $sql = file_get_contents(ROOT_PATH."/Plugins/ZhanqiSign/zhanqisign.sql");
        $db->exec($sql);
        $config = new \stdClass();
        $config->name = 'zhanqisign';
        $config->class = 'Plugins\\ZhanqiSign\\Register_ZhanqiSign';
        $config->enable = 1;
        $callback($config);
    }
}